#include <stdio.h>

#include "utringbuffer.h"

UT_icd long_icd = {sizeof(long), NULL, NULL, NULL};

int main(){
	long l, *p;
	UT_ringbuffer *nums;

	utringbuffer_new(nums, 1, &long_icd);

	l = 1; utringbuffer_push_back(nums, &l);
	l = 2; utringbuffer_push_back(nums, &l);

	p = NULL;
	while((p = (long *)utringbuffer_next(nums, p)))
		printf("%ld\n", *p);

	utringbuffer_free(nums);

	return 0;
}
